package com.wwz.frame.controller;

import com.wwz.frame.entity.ResponseVo;
import com.wwz.frame.entity.SwaggerDemo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @Description
 * @Author wwz
 * @Date 2019/08/15
 * @Param
 * @Return
 */
@Api(value = "swaggerController", tags = "swagger讲解")
@RestController
@RequestMapping("/swagger")
public class SwaggerController {

    @ApiOperation("bean操作")
    @PostMapping
    public ResponseVo save(@RequestBody SwaggerDemo swaggerDemo) {
        return new ResponseVo(200, "成功");
    }

    @ApiOperation("单个搜索条件")
    @GetMapping
    @ApiImplicitParam(name = "name", required = true,value = "姓名")
    public ResponseVo getList(String name){
        return new ResponseVo(200, "成功");
    }
    @ApiOperation("多个搜索条件")
    @GetMapping("getList")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", required = true,value = "姓名"),
            @ApiImplicitParam(name = "id", required = true,value = "id")
    })
    public ResponseVo getAllList(String name,Integer id){
        return new ResponseVo(200, "成功");
    }
}
